package com.example.word.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author: Jingtao_Wu
 * @DATE: 2021-03-04 17:17
 **/

@Configuration
@EnableOpenApi
public class SwaggerConfig {
    @Bean
    public Docket dataManagerApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("checkSystem")
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.example.word.controller"))
                .paths(PathSelectors.any()).build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("作业查虫系统")
                .description("作业查虫系统")
                .termsOfServiceUrl("-----")
                .contact(new Contact("fair","----", "17326083818@163.com"))
                .version("1.0").build();
    }
}
